/**
 * Copyright (C), 2018-2020, 飞尔智能有限公司
 * FileName: UserService
 * Author:   杨乐
 */
package com.yangle.eurekaclientproducter;

import com.yangle.feign.User;
import com.yangle.feign.UserFeign;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @description:
 * @Author 杨乐
 * @Date 2020/2/3 21:10
 * @Version 1.0
 **/
@RestController
public class UserService implements UserFeign {

    @Override
    public User getUser(String name) {
        User user=new User();
        user.setName(name);
        user.setEmail("xxx@qq.com");
        return user;
    }

    @Override
    public User getUser(@RequestParam Map<String, String> param) {
        User user=new User();
        user.setName(param.get("name"));
        user.setEmail("xxx@qq.com");
        return user;
    }

    @Override
    public User addUser(String name, String email) {
        User user=new User();
        user.setName(name);
        user.setEmail(email);
        return user;
    }

    @Override
    public User addUser(@RequestBody User user) {
        return user;
    }
}
    
